namespace Yoozoo.Gameplay.RTS
{
    public class ActionFactory
    {
        public ISubAction ConvertAttackActionInfoCfgToSubAction(AttackActionInfo info)
        {
            ISubAction action = null;
            switch (info.type)
            {
                case SubActionType.Attack:
                    action = new AttackStateSubAction();
                    break;
                case SubActionType.PlayAnimation:
                    action = new PlayAnimationStateSubAction();
                    break;
                case SubActionType.Throw:
                    action = new ThrowStateSubAction();
                    break;
            }
            action?.Init(info);
            return action;
        }
    }
}